# /*
#  * @Author: TanFunWen 
#  * @Date: 2021-10-21 07:10:23 
#  * @Last Modified by:   TanFunWen 
#  * @Last Modified time: 2021-10-21 07:10:23 
#  */

# 汉诺塔问题
"""
每次只移动一块
大的盘子不能在小的盘子上面
"""

def moveTower(height, fromPole, withPole, toPole):
    if height >= 1:
        moveTower(height-1, fromPole, toPole, withPole)
        moveDisk(height, fromPole, toPole)
        moveTower(height-1, withPole, fromPole, toPole)

def moveDisk(disk, fromPole, toPole):
    print(f"Moving disk[{disk}] from {fromPole} to {toPole}")

moveTower(20, "#1", "#2", "#3")